import { Column, Entity, PrimaryGeneratedColumn, BeforeInsert, CreateDateColumn, Generated, OneToOne, JoinColumn, ManyToOne } from 'typeorm'
import { User } from './user.entity'
@Entity()
export class Tags {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    tags: string

    // 表关联，ManyToOne表示多对一，在关联表中要有对应的关联
    @ManyToOne(() => User, (user) => user.tags)
    @JoinColumn()
    user: User

} 